Skip to main content
Access via:io.appManager

Application Management API.

Properties (3)

Property Type Default Required Description
inMemory⚓︎ InMemory x

Object that can be used for handling app definitions dynamically.

myApplication⚓︎ Application x

Returns the current app.

myInstance⚓︎ Instance x

The instance of the application.

12 Methods

application()⚓︎

(name: string) => Application

Returns an application by name.

Parameters (1)

Name Type Required Description
name⚓︎ string

Name of the desired application.

Returns

The application.

applications()⚓︎

() => Application[]

Returns a list of all applications.

Returns

A list of all applications.

exit()⚓︎

(options?: ExitOpts) => Promise<any>

Exits io.Connect.

Parameters (1)

Name Type Required Description
options⚓︎ ExitOpts x x

instances()⚓︎

() => Instance[]

Returns an array with all running application instances.

Returns

A list of all running application instances.

onAppAdded()⚓︎

(callback: (app: Application) => any) => UnsubscribeFunction

Notifies when an application is registered in the environment. Replays the already added applications.

Parameters (1)

Name Type Required Description
callback⚓︎ (app: Application) => any

Callback function to handle the event. Receives the added application as a parameter.

Returns

Unsubscribe function.

onAppChanged()⚓︎

(callback: (app: Application) => any) => UnsubscribeFunction

Notifies when the configuration for an application has changed.

Parameters (1)

Name Type Required Description
callback⚓︎ (app: Application) => any

Callback function to handle the event. Receives the changed application as a parameter.

Returns

Unsubscribe function.

onAppRemoved()⚓︎

(callback: (app: Application) => any) => UnsubscribeFunction

Notifies when the application is removed from the environment.

Parameters (1)

Name Type Required Description
callback⚓︎ (app: Application) => any

Callback function to handle the event. Receives the removed application as a parameter.

Returns

Unsubscribe function.

onInstanceStarted()⚓︎

(callback: (instance: Instance) => any) => UnsubscribeFunction

Notifies when a new application instance has been started. Replays the already started instances.

Parameters (1)

Name Type Required Description
callback⚓︎ (instance: Instance) => any

Callback function to handle the event. Receives the started application instance as a parameter.

Returns

Unsubscribe function.

onInstanceStopped()⚓︎

(callback: (instance: Instance) => any) => UnsubscribeFunction

Notifies when an application instance has been stopped.

Parameters (1)

Name Type Required Description
callback⚓︎ (instance: Instance) => any

Callback function to handle the event. Receives the stopped application instance as a parameter.

Returns

Unsubscribe function.

onShuttingDown()⚓︎

(callback: (args: ShuttingDownEventArgs) => Promise<{ prevent: boolean }>) => void

Notifies when io.Connect will shut down or restart. If the callback is asynchronous, it will be awaited up to 60 seconds before shutdown continues.

Parameters (1)

Name Type Required Description
callback⚓︎ (args: ShuttingDownEventArgs) => Promise<{ prevent: boolean }>

Callback function for handling the event.

ready()⚓︎

() => Promise<void>

Notifies when the App Management API is ready to be used.

restart()⚓︎

(options?: ExitOpts) => Promise<any>

Restarts io.Connect.

Parameters (1)

Name Type Required Description
options⚓︎ ExitOpts x x